package com.oceansoft.mobile.econsole.mybaties.dialect;

/**
 * A dialect compatible with the H2 database.
 *
 * @author Thomas Mueller
 */
public class H2Dialect extends Dialect {

    public boolean supportsLimit() {
        return true;
    }

    public String getLimitString(String sql, int offset, String offsetPlaceholder, int limit, String limitPlaceholder) {
        return sql + ((offset > 0) ? " limit " + limitPlaceholder + " offset " + offsetPlaceholder : " limit " + limitPlaceholder);
    }

    @Override
    public boolean supportsLimitOffset() {
        return true;
    }
    //    public boolean bindLimitParametersInReverseOrder() {
    //        return true;
    //    }
    //
    //    public boolean bindLimitParametersFirst() {
    //        return false;
    //    }
}